<script type="text/javascript" >
    function set_size(){
        var size = jQuery("#result").height();
        size = size+50;
        jQuery(".pp_content").attr('style','height:'+size+'px');
    }
    stFacebookToolbox.load_tooltip();
    stFacebookToolbox.on_submitform('#settingForm');
    jQuery(".galleryVideo a[rel^='prettyPhoto']").prettyPhoto({
    theme:'facebook',
    keyboard_shortcuts: false
        });
    //jQuery( "#accordion" ).accordion();
    stFacebookToolbox.shortAction();
</script>

<div class="w100p bgl">
    <div class="w100p bgr p5b">
                <ul class="menu_right">

                    <li>
                        <a style="cursor: pointer;top:0px;" onclick="stFacebookToolboxcustom.loadPage('add_new_form');" class="button add-new-h2 anchor">
                       <b>Add new form</b>
                    </a>
                    </li>
                    <li>
                        <a style="cursor: pointer;top:0px;" onclick="jQuery.prettyPhoto.loadPage('entries_display_option&id=<?php echo $default_id;?>',null,null,function(){set_size();});" class="button add-new-h2 anchor">
                       <b>Display options</b>
                    </a>
                    </li>
                    <li>
                        <a style="cursor: pointer;top:0px;" onclick="jQuery.prettyPhoto.loadPage('entries_csv_option&id=<?php echo $default_id;?>',null,null,function(){set_size();});" class="button add-new-h2 anchor">
                       <b>Export to CSV</b>
                    </a>
<!--                    <li>
                        <a style="cursor: pointer;top:0px;" onclick="window.location = '<?php echo $config['pluginPath'].'csv/export.php?id='.$default_id;?>';" class="button add-new-h2 anchor">
                       <b>Export to CSV</b>
                    </a>-->
                    </li>
                   
                </ul>
      <input type="hidden" id="field_display" />
      <table cellspacing="0" class="widefat" align="center">
          <?php 
         
          ?>
                <thead>
                    <tr>
                                <th style="" class="manage-column column-uid" id="date" scope="col">Date update</th>
                                <?php foreach($menu as $me):?>
                        	<th style="" class="manage-column column-uid" id="date" scope="col"><?php echo $me->element_title;?></th>
                                <?php endforeach;?>
				
                    </tr>
                </thead>
                <tbody>
                <?php $stt = 1;foreach($result as $row):$id = $row->form_id;$json = json_decode($row->json); ?>
                <tr class="bg_gray<?php echo (($stt % 2) == 0)?'1':'2'?>" id="<?php echo $row->date_created;?>">
                                <td><?php echo $row->date_created;?>
                                    <div class="row-actions short_action">
                                    <span class='edit' action='' style="cursor:pointer;" short_action='' onclick='jQuery.prettyPhoto.loadPage("view_form_popup&view=<?php echo $row->id;?>&id=<?php echo $row->form_id;?>",null,null,function(){set_size();});' id='<?php echo $row->id;?>'>View | </span><span class='trash' short_action='delete' style="cursor:pointer;" id='<?php echo $row->id;?>' confirm='Are you sure you want to delete this entry?'>Trash </span></div>
                                </td>
                                 <?php foreach($menu as $me):?>
                                <td onclick='jQuery.prettyPhoto.loadPage("view_form_popup&view=<?php echo $row->id;?>&id=<?php echo $row->form_id;?>",null,null,function(){set_size();});' style="cursor:pointer;"><?php echo str_replace(',','<br>',$json->{$me->element_title}) ;?></td>
                                <?php endforeach;?>
				</tr>
				<?php $stt++; endforeach;?>
				</tbody>
            </table>
        <div style="padding:10px;">
<a class="button add-new-h2 anchor" onclick="var data = Array();data['default_id'] =<?php echo $default_id;?>;stFacebookToolbox.loadPage('applications',data);" style="cursor: pointer;top:0px;">
                       <b>Return to form</b>
                    </a>
            
        </div>
    </div>
</div>
<input type="hidden" id="default_id" value="<?php echo $default_id;?>" />
